# http请求类（可以根据传递的method--get/post完成不同的请求），要求有返回值。
import requests
class HttpRequests:
    def request(self,method,url,param,Cookies):
        '''
        http请求类
        method:请求方式
        url:请求地址
        param:要传入的参数
        '''
        if method.upper() == "GET":
            res = requests.get(url,params=param,cookies=Cookies)#get请求
            return res
        elif method.upper() == "POST":#post请求
            res = requests.post(url,data=param,cookies=Cookies)
            return res
if __name__ == '__main__':
    url = "http://47.107.168.87:8080/futureloan/mvc/api/member/login"  # 接口地址
    param = {"mobilephone": "15018549200", "pwd": "123456"}
    res = HttpRequests().request("Get",url,param)
    print(res.text)







